package com.tom.architect.party4.day34;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.util.Log;

import com.tom.architect.R;
import com.tom.architect.party4.day34.retrofit.Call;
import com.tom.architect.party4.day34.retrofit.Callback;
import com.tom.architect.party4.day34.retrofit.Response;
import com.tom.architect.party4.day34.simple.RetrofitClient;
import com.tom.architect.party4.day34.simple.UserLoginResult;

public class MainActivity34 extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main34);

        RetrofitClient.getServiceApi().userLogin("abc", "12")
                .enqueue(new Callback<UserLoginResult>() {
                    @Override
                    public void onResponse(Call<UserLoginResult> call, Response response) {
                        Log.e("TAG", "onResponse: " + response.body.toString());
                    }

                    @Override
                    public void onFailure(Call<UserLoginResult> call, Throwable e) {
                        e.printStackTrace();
                    }
                });
    }

}

